package cn.doitedu.rest.api.service;


import cn.doitedu.rest.api.beans.UvBean;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@Service
public class AService {

    public int add(int a,int b){
        return a+b+10;
    }


    public int mine(int a,int b){
        return a-b;
    }


    public int getUvAmount(String dt){

        Random random = new Random();

        return random.nextInt(10)*1000+random.nextInt(10)*100;
    }


    public List<UvBean> getUvProvinceAndCity(String dt){

        // 根据日期，去省市维度uv报表中查询当天的数据
        UvBean b1 = new UvBean("湖北省", "武汉市", 800,dt);
        UvBean b2 = new UvBean("湖北省", "黄冈市", 600,dt);
        UvBean b3 = new UvBean("湖北省", "襄阳市", 700,dt);
        UvBean b4 = new UvBean("山东省", "青岛市", 1200,dt);
        UvBean b5 = new UvBean("山东省", "德州市", 900,dt);
        UvBean b6 = new UvBean("山东省", "济南市", 500,dt);

        ArrayList<UvBean> uvBeans = new ArrayList<>();
        uvBeans.add(b1);
        uvBeans.add(b2);
        uvBeans.add(b3);
        uvBeans.add(b4);
        uvBeans.add(b5);
        uvBeans.add(b6);

        return uvBeans;

    }


}
